package org.swingplus.core.utils;

import java.lang.reflect.InvocationTargetException;

import org.apache.commons.beanutils.BeanUtils;
import org.swingplus.core.bean.DefinitionMetadata;
import org.swingplus.core.bean.RootBeanDefinition;

public class ObjectConvertUtil {

	public static RootBeanDefinition definitionMetadataToRootBeanDefinition(DefinitionMetadata definitionMetadata) {
		RootBeanDefinition rootBeanDefinition = new RootBeanDefinition();
		try {
			BeanUtils.copyProperties(rootBeanDefinition, definitionMetadata);
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return rootBeanDefinition;

	}

}
